﻿<%@ Page Title="Edición del Menú General" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="EditGeneralMenu.aspx.cs" Inherits="Menu_EditGeneralMenu" %>

<%@ Register Assembly="ESF.Web" Namespace="ESF.Web.ServerControls" TagPrefix="cc1" %>

<%@ Register src="EditUserMenu.ascx" tagname="EditUserMenu" tagprefix="uc1" %>

<asp:Content ContentPlaceHolderID="cntEncabezado" runat="server" ID="cntEncabezado">
</asp:Content>

<asp:Content ID="cntContenido" ContentPlaceHolderID="cntContenido" Runat="Server">

	<div class="divForm">
		<div class="header">
			<div class="title">
				<asp:Label ID="lblTitle" runat="server"></asp:Label>
			</div>
			<div class="subtitle">
				Edite aqui para cada aplicación los menus disponibles.
			</div>
		</div>
		<asp:UpdatePanel ID="updFilterFields" runat="server" UpdateMode="Conditional">
			<Triggers>
				<asp:AsyncPostBackTrigger ControlID="btnClear" />
			</Triggers>
			<ContentTemplate>
				<asp:Panel ID="divFilterFields" runat="server" DefaultButton="btnShowMenuForApp">
				<div class="divField">
					<div class="label">
						Aplicación *
						<asp:RequiredFieldValidator ID="rfvddlApplication" runat="server" ErrorMessage="Seleccione una aplicación para ver su menú" Text="*" ControlToValidate="ddlApplication" Display="Dynamic"></asp:RequiredFieldValidator>
					</div>
					<div class="field">
						<asp:DropDownList ID="ddlApplication" runat="server"></asp:DropDownList>
					</div>
				</div>
				<div class="divOperations">
					<asp:Button ID="btnShowMenuForApp" runat="server" Text="Mostrar Menú" 
						onclick="btnShowMenuForApp_Click"/>
					<asp:Button ID="btnClear" runat="server" Text="Limpiar" UseSubmitBehavior="false"
						onclick="btnClear_Click" CausesValidation="false" />
				</div>
			</asp:Panel>
			</ContentTemplate>
		</asp:UpdatePanel>
		<asp:UpdatePanel ID="updEdition" runat="server" UpdateMode="Conditional">
		<Triggers>
			<asp:AsyncPostBackTrigger ControlID="uscGenericTreeView" />
			<asp:AsyncPostBackTrigger ControlID="btnClear" />
			<asp:AsyncPostBackTrigger ControlID="btnShowMenuForApp" />
		</Triggers>
		<ContentTemplate>
				<div id="divEdition" visible="false" runat="server" style="float:left;width:100%;">
					<div class="divColField">
						<div class="divField">
							<div class="label">Menus</div>
							<div class="field" style="overflow:auto; height:373px;">
								<cc1:GenericTreeView ID="uscGenericTreeView" runat="server" ShowCheckBoxes="None" 
									TextDataMember="Name" 
									ValueDataMembers="ID,Code" 
									CssClass="treeView" 
									ToolTipDataMember="Description"
									SelectedNodeStyle-CssClass="selectedNode"
									HoverNodeStyle-CssClass="hoverNode"	
									NodeStyle-CssClass="node"
									onselectnodegetchildren="uscGenericTreeView_SelectNodeGetChildren">
								</cc1:GenericTreeView>
							</div>
							<div class="divOperations">
								<asp:Button ID="btnAddNewRoot" Text="Agregar Raiz" runat="server" 
									onclick="btnAddNewRoot_Click" UseSubmitBehavior="false" />							
								<asp:Button ID="btnAddNewChild" Text="Agregar Hijo" runat="server" 
									onclick="btnAddNewChild_Click" UseSubmitBehavior="false" />
							</div>
						</div>
					</div>
					<div class="divColField">
						<uc1:EditUserMenu ID="uscEditUserMenu" runat="server" Visible="false" OnSave="uscEditUserMenu_OnSave" OnDelete="uscEditUserMenu_OnDelete" />
					</div>
				</div>
			</ContentTemplate>
		</asp:UpdatePanel>
	</div>
</asp:Content>